Skip to content

NoneType hint: missing return first, then print - #33

Merged
cedricvogel-leo merged 1 commit into
mainfrom
fix/none-hint-wording
Oct 26, 2026
Merged

cedricvogel-leo merged 1 commit into
mainfrom
fix/none-hint-wording

Conversation

@cedricvogel-leo

Copy link
Copy Markdown
Collaborator

New wording for the hint on a None operand (package 2, kind none-operand):

before after
de Ein Wert ist None. Gibt eine Funktion ihr Ergebnis mit print aus statt mit return? Ein Wert ist None. Fehlt in einer Funktion das return – oder gibt sie ihr Ergebnis mit print aus?
en A value is None. Does a function output its result with print instead of return? A value is None. Is a function missing its return – or does it output its result with print?

In the design recipe (course Etappe 2) the more common cause is a function without a return yet: its body is only the docstring while the examples are being written. The old hint sent learners towards print.

  • src/i18n.ts (de and en), and scripts/check-error-hints.mjs with the new texts.
  • Unchanged: when the hint shows (hints.py, check-runtime-hints.py).

Lint (known warning only), both builds, test:hints and test:runtime pass. After the merge I tag a new version and bump the IDE.

🤖 Generated with Claude Code

In the design recipe (course Etappe 2) a None operand usually comes from a
function that has no return yet - its body is only the docstring while the
examples are being written - so the hint pointing only to print sent
learners the wrong way. Now: «Ein Wert ist `None`. Fehlt in einer Funktion
das `return` – oder gibt sie ihr Ergebnis mit `print` aus?» (en: "A value
is `None`. Is a function missing its `return` – or does it output its
result with `print`?").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cedricvogel-leo
cedricvogel-leo merged commit 1666e81 into main Oct 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant